package com.hylink.util;

import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;

public class MapUtil {
    public static Map<String, String> moduleMap = new HashMap<String, String>();
    private static Map<String, String> map = ConfigUtil
            .getBundleInfoMap("common/config/map");

    public static String getMapName(String key) {
        return map.get(key);
    }

    public static String getMapKey(String value) {
        String returnValue = null;
        if (value != null) {
            Set<Entry<String, String>> set = map.entrySet();
            for (Entry<String, String> entry : set) {
                if (entry.getValue().equals(value.trim())) {
                    returnValue = (String) entry.getKey(); // 把符合条件的项先放到容器中,下面再一次性打印出
                    break;
                }
            }
        }
        return returnValue;
    }
}
